package com.io;

import java.io.File;
import java.io.IOException;

public class HomeWork_1 {
    public static void main(String[] args) {
        String path = "D:\\javacode\\javacode\\J2024_11_17\\mytemp";
        File file = new File(path);
        file.mkdirs();
        String pathname = "D:\\javacode\\javacode\\J2024_11_17\\mytemp\\hello.txt";
        File file1 = new File(pathname);
        if (file1.exists()) {
            System.out.println("hello.txt已经存在");
        } else {
            try {
                file1.createNewFile();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
